package com.banner;

import com.tuniu.R;
import com.xinbo.utils.UILUtils;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

/**
 * A simple {@link Fragment} subclass.
 *
 */
public class BannerHomeFragment extends Fragment {

	private View view;
	private String imagUrl;

	public BannerHomeFragment() {
		// Required empty public constructor
	}

	public BannerHomeFragment(String imagUrl){
		this.imagUrl = imagUrl;
	}
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		
		if(view==null){
			view = inflater.inflate(R.layout.fragment_banner_home, container, false);
			initUI();
		}
		
		return view;
		
		
	}

	private void initUI() {
		ImageView banner = (ImageView) view.findViewById(R.id.single_image);		
		UILUtils.displayImage(imagUrl, banner);
	}

}
